package com.mdxl.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.Map;

/**
 * Created by chengjian on 2017/9/18.
 */
@Controller
public class thymeleafController {
    @GetMapping("/apiRestDoc")
    public Map<String, Object> greeting() {
        return Collections.singletonMap("message", "Hello World");
    }
    //RestController 包含Controller和ResponseBody,那么写成RestConbtrolller怎返回hello而不是hello.html
    @GetMapping("/thymeleaf")
    public String hello(){
        return "hello";
    }
}
